package com.iweb.springboot_demo1.service.impl;

import com.iweb.springboot_demo1.dto.DTOstu_email;
import com.iweb.springboot_demo1.mapper.StudentMapper;
import com.iweb.springboot_demo1.pojo.Student;
import com.iweb.springboot_demo1.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> findallstu() {
        return studentMapper.selectAll();
    }

    @Override
    public int insertstu(Student stu) {
        return studentMapper.insert(stu);
    }

    @Override
    public int updatestu(Student stu) {
        return studentMapper.update(stu);
    }

    @Override
    public int deletestu(int id) {
        return studentMapper.deleteById(id);
    }
}
